/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package plures;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.HashMap;
import persistence.FilePersistence;

/**
 *
 * @author Guilherme
 */
public class Backup extends FilePersistence
{
    private HashMap<Integer,Data>   map;
    private String                  fileName;
    
    public Backup(int key){
        super("backup_" + key);
        this.map = new HashMap<>();
    }
    
    public void replace(int client, Data d)
    {
        this.map.put(client, d);
    }
    
    public void clear()
    {
        this.map.clear();
    }
    
    public Data getClientBackup(int client)
    {
        return this.map.get(client);
    }
    
    public int size()
    {
        return this.map.size();
    }
}
